package com.ellwood.copyright.common.core.base;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @ProjectName: ell-copyright-pro
 * @PackageName: com.ellwood.copyright.common.core.base
 * @ClassName: EntityFactory
 * @Description: // 实体基类
 * @Author: Ellwood
 * @CreateDate: 2024/11/11 - 11:38
 * @Version: V1.0.0
 */
@Data
public abstract class EntityFactory implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /** 乐观锁 */
    @Version
    @TableField(fill = FieldFill.INSERT)
    private Integer version ;

    /** 状态：0：正常 1：锁定 */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer isState ;

    /** 逻辑删除：0：未删除 1：已删除 */
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private Integer isDeleted ;

    /** 创建人 */
    @TableField(fill = FieldFill.INSERT)
    private Long  createBy ;

    /** 创建时间 */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime ;

    /** 更新者 */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateBy ;

    /** 更新时间 */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime ;

}
